using System;
using System.Data;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

/// <summary>
/// Summary description for FormdViewHelper
/// </summary>
public partial class ControlHelper
{
    public void FillDataTableToFormView(
    FormView formView)
    {


        DataTable dataTable =
        sqlServerProvider.GetDataTable();
        if (dataTable != null)
        {
            formView.DataSource = dataTable;
        }
        else
            formView.DataSource = null;
        formView.DataBind();
    }
    
    public void FillDataTableToFormView(
    FormView formView, 
    int pageCount, 
    PagerButtons pagerButtons)
    {

        formView.AllowPaging=true;
        DataTable dataTable =
        sqlServerProvider.GetDataTable();
        if (dataTable != null)
        {
            formView.DataSource = dataTable;            
            formView.PagerSettings.PageButtonCount = pageCount;
            formView.PagerSettings.Mode = pagerButtons;
        }
        else
            formView.DataSource = null;
        formView.DataBind();
    }
}
